export function isAsyncFunction(a) {
	return Object.prototype.toString.call(a) === '[object AsyncFunction]'
}

export function isFunction(a) {
	return typeof a === 'function'
}

export function versionCompare(a, b) {
	const aArr = a.split('.').map(Number)
	const bArr = b.split('.').map(Number)
	const len = Math.max(aArr.length, bArr.length)
	for (let i = 0; i < len; i++) {
		const numA = aArr[i] || 0
		const numB = bArr[i] || 0
		if (numA < numB) {
			return -1
		} else if (numA > numB) {
			return 1
		}
	}
	return 0
}